package cn.com.duiba.millionaire.center.spider.dao.appinfo.impl;

import cn.com.duiba.millionaire.center.biz.constants.DatabaseSchema;
import cn.com.duiba.millionaire.center.biz.dao.BaseDao;
import cn.com.duiba.millionaire.center.spider.dao.appinfo.XiaoMiLocalSpiderDao;
import cn.com.duiba.millionaire.center.spider.entity.SpiderAppInfoEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by sunchangji on 2018/6/12.
 */
@Repository
public class XiaoMiLocalSpiderDaoImpl extends BaseDao implements XiaoMiLocalSpiderDao {
    @Override
    public int inserAppInfo(SpiderAppInfoEntity entity) {
        return insert("inserAppInfo",entity);
    }

    @Override
    public List<SpiderAppInfoEntity> findPage(int offset, int pageSize) {
        Map<String,Object> params = new HashMap<>();
        params.put("offset",offset);
        params.put("pageSize",pageSize);
        return selectList("findPage",params);
    }

    @Override
    protected DatabaseSchema chooseSchema() {
        return DatabaseSchema.MILLIONAIRE_CONFIG;
    }
}
